#!/bin/sh
echo "这是Golang 1.10.3安装程序"
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
sudo tar -zxf go1.10.3.linux-amd64.tar.gz -C /usr/local
mkdir $HOME/go
echo "export GOROOT=/usr/local/go" >> ~/.profile
echo "export GOPATH=$HOME/go" >> ~/.profile
echo "export PATH=$PATH:$GOROOT/bin:$GOPATH/bin" >> ~/.profile   #这句话可以需要自行复制
#source ~/.profile   #source命令不生效
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
go version